package com.profound.blog.dao;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.profound.blog.bean.Country;
import com.sun.org.apache.xalan.internal.xsltc.compiler.Template;

@Repository
public class CountryDAO {
	
	private static final String COUNTRY_CLASS_NAME = Country.class.getName();

	@Autowired
	private SqlSessionTemplate temp;
	
	public List<Country> listAll() {
		return this.temp.selectList(COUNTRY_CLASS_NAME+".listAll");
	}
	
	public static void main(String[] args) {
		CountryDAO dao = new CountryDAO();
		try{
			List<Country> list = dao.listAll();
			System.out.println(list);
		}catch(Exception e){
			e.printStackTrace();
		}
	}

}
